<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var js2 = 59,pen2 = 30,glasses2 = 199,milk2 = 68
    var js = parseInt(prompt('请输入购买的《JavaScript》书的数量：'))
    var pen = parseInt(prompt('请输入购买的钢笔的数量：'))
    var glasses = parseInt(prompt('请输入购买的眼镜的数量：'))
    var milk = parseInt(prompt('请输入购买的牛奶的数量：'))
    if(js == 1){
        var js1 = 0.9*js2
    }else if(js == 2){
        var js1 = 0.8*js*js2
    }else if(js == 3){
        var js1 = 0.7*js*js2
    }else if(js >= 4){
        var js1 = 0.65*js*js2
    }
    if(pen == 1){
        var pen1 = 0.9*pen2
    }else if(pen == 2){
        var pen1 = 0.8*pen*pen2
    }else if(pen == 3){
        var pen1 = 0.7*pen*pen2
    }else if(pen >= 4){
        var pen1 = 0.65*pen*pen2
    }
    if(glasses == 1){
        var glasses1 = 0.9*glasses2
    }else if(glasses == 2){
        var glasses1 = 0.8*glasses*glasses2
    }else if(glasses == 3){
        var glasses1 = 0.7*glasses*glasses2
    }else if(glasses >= 4){
        var glasses1 = 0.65*glasses*glasses2
    }
    if(milk == 1){
        var milk1 = 0.9*milk2
    }else if(milk == 2){
        var milk1 = 0.8*milk*milk2
    }else if(milk == 3){
        var milk1 = 0.7*milk*milk2
    }else if(milk >= 4){
        var milk1 = 0.65*milk*milk2
    }
    var zong = js1+pen1+glasses1+milk1
    document.write(zong)
</script>
</html>